<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>动态组件加载测试20200518</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <!--ie渲染引擎-->
    <!--忽略电话号码和email识别-->
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <!--当网站添加到主屏幕快速启动方式，将网站添加到主屏幕快速启动方式-->
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <!--隐藏ios上的浏览器地址栏-->
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <!-- UC默认竖屏 ，UC强制全屏 -->
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <!-- QQ强制竖屏 QQ强制全屏 -->
    <meta name="x5-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="x5-page-mode" content="app">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
    <link rel="stylesheet" href="../../resources/assets/css/bootstrap.min.css">
    <link rel="stylesheet" href="../../resources/assets/css/beyond.min.css" />
    <link rel="stylesheet" href="../../resources/assets/css/demo.min.css"  />
    <link rel="stylesheet" href="../../resources/assets/css/font-awesome.min.css" />
    <link rel="stylesheet" href="../../resources/app/css/app.css">
  </head>
  <body>


<template>
    <div class="container">
        <div id="app" >
        <br/>
        {{msg}}
        <br/>
        <button type="button" @click="testClick"> 测试按钮 </button>
        </div>
        
    </div>
</template>
<div id="hostElement"></div>

<script src ="../../resources/assets/js/jquery-2.0.3.min.js"></script>
<script src ="../../resources/assets/js/bootstrap.min.js"></script>
<script src ="../../resources/app/js/vue-online.js"></script>
<script src ="../../resources/app/js/vue-router.js"></script>



<script>
// create shadow DOM on the <p> element above
const shadow = document.querySelector('#hostElement').attachShadow({mode: 'open'});
const template = document.querySelector('template');
shadow.appendChild(document.importNode(template.content, true));
var style = document.createElement('style');
style.textContent = `
	div {
	background: red;
	border-radius: 30px;
	padding: 20px;
	font-size: 20px;
	text-align: center;
	width: 300px;
	margin: 0 auto;
}

button {
  color: blue;
}


`;

shadow.appendChild(style);




const shadowRoot = document.querySelector('#hostElement').shadowRoot;

new Vue({
    el: shadowRoot.querySelector('#app'),
    data:{
    	msg:'hello word'
    },
    methods:{
		  testClick() {
			  alert('demo-comp click');
		  }
		}
})

</script>

</body>
</html>
